package com.neo.base.actorTest
class ActorTest {
   def sumOfFactors(number: Int) = {
      (0 /: (1 to number)) { (sum, i) => if (number % i == 0) sum + i else sum }
   }

   def isPerfect(candidate: Int) = 2 * candidate == sumOfFactors(candidate)
}

object ActorTest{

  def main(args: Array[String]): Unit = {
    val actorstest = new ActorTest
    println("6 is perfect? " + actorstest.isPerfect(6))
    println("33550336 is perfect? " + actorstest.isPerfect(33550336))
    println("33550337 is perfect? " + actorstest.isPerfect(33550337))
  }


}
